/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package action.news;

import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.interceptor.ServletRequestAware;
import po.News;
import service.NewsService;

/**
 *
 * @author sony
 */
public class EditNewsAction extends ActionSupport implements ServletRequestAware {

    private HttpServletRequest request;
 
    int newsId;
    News news;
    NewsService newsService;

    @Override
    public String execute() {
        
        newsId = Integer.parseInt(request.getParameter("newsId"));
        news = newsService.getNews(newsId);
        return SUCCESS;
    }

    public void setServletRequest(HttpServletRequest arg0) {
        this.request = arg0;
    }


    public int getNewsId() {
        return newsId;
    }

    public void setNewsId(int newsId) {
        this.newsId = newsId;
    }

    public News getNews() {
        return news;
    }

    public void setNews(News news) {
        this.news = news;
    }

    public NewsService getNewsService() {
        return newsService;
    }

    public void setNewsService(NewsService newsService) {
        this.newsService = newsService;
    }

}

